<template>
  <el-descriptions title="原告" :column="1">
    <el-descriptions-item label="公司名称">{{ info.company_info?.name }}</el-descriptions-item>
    <el-descriptions-item label="项目">{{ info.community_info?.name }}</el-descriptions-item>
  </el-descriptions>
  <el-descriptions title="被告" :column="2">
    <el-descriptions-item label="姓名">{{ info.defendant_info?.name }}</el-descriptions-item>
    <el-descriptions-item label="电话">{{ info.defendant_info?.mobile }}</el-descriptions-item>
    <el-descriptions-item label="地址">{{ info.defendant_info?.address }}</el-descriptions-item>
  </el-descriptions>
  <el-descriptions title="欠费金额" :column="2">
    <el-descriptions-item label="总金额">
      <div class="inline-block align-top">
        <el-money :num="info.countAmount" /><br />
        <span class="text-xs text-gray-400 mt-2">{{ number2text(info.countAmount) }}</span>
      </div>
    </el-descriptions-item>
    <el-descriptions-item label="欠费金额">
      <div class="inline-block align-top">
        <el-money :num="info.arrears_info?.amount" /><br />
        <span class="text-xs text-gray-400 mt-2">{{ number2text(info.arrears_info?.amount) }}</span>
      </div>
    </el-descriptions-item>
    <el-descriptions-item label="滞纳金金额">
      <div class="inline-block align-top">
        <el-money :num="info.arrears_info?.overdue_fine_amount" /><br />
        <span class="text-xs text-gray-400 mt-2">{{ number2text(info.arrears_info?.overdue_fine_amount) }}</span>
      </div>
    </el-descriptions-item>
  </el-descriptions>
  <el-descriptions title="开庭信息" :column="2">
    <el-descriptions-item label="开庭法院">{{ info.court_name }}</el-descriptions-item>
    <el-descriptions-item label="法庭">{{ info.court_number }}</el-descriptions-item>
    <el-descriptions-item label="开庭时间">{{ info.open_datetime }}</el-descriptions-item>
    <el-descriptions-item label="开庭律师">{{ info.open_court_user_name }}</el-descriptions-item>
    <el-descriptions-item label="判决书" v-if="info.pj_result_url">
      <el-link type="primary" :href="info.pj_result_url" target="_blank">查看判决书</el-link>
    </el-descriptions-item>
    <el-descriptions-item label="调解书" v-if="info.tj_result_url">
      <el-link type="primary" :href="info.tj_result_url" target="_blank">查看调解书</el-link>
    </el-descriptions-item>
  </el-descriptions>
</template>

<script setup>
import { number2text } from '@/utils';
const props = defineProps({
  info: {
    type: Object,
    default: () => ({})
  },
})
</script>